package sist.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import sist.bean.PageRank;

@Controller
public class PageExcelController {
	
	@RequestMapping(value="pageRanks.do")
	public ModelAndView excelProcess(){
		List<PageRank>pageRanks=new ArrayList<PageRank>();
		pageRanks.add(new PageRank(1,"say@nate.com","les","seoul"));
		pageRanks.add(new PageRank(2,"blue@nate.com","oop","busan"));
		pageRanks.add(new PageRank(3,"red@nate.com","java","masan"));
		
		return new ModelAndView("pageRanksView","pageRanks",pageRanks);
	}
	
	@RequestMapping(value="pdfRanks.do")
	public ModelAndView pdfProcess(){
		List<PageRank>pageRanks=new ArrayList<PageRank>();
		pageRanks.add(new PageRank(1,"say@nate.com","les","seoul"));
		pageRanks.add(new PageRank(2,"blue@nate.com","oop","busan"));
		pageRanks.add(new PageRank(3,"red@nate.com","java","masan"));
		
		return new ModelAndView("pageReportView","pdfModel",pageRanks);
	}
	
	@RequestMapping(value="jSonRank.do")
	public ModelAndView jSonProcess(){
		List<PageRank>pageRanks=new ArrayList<PageRank>();
		pageRanks.add(new PageRank(1,"say@nate.com","les","seoul"));
		pageRanks.add(new PageRank(2,"blue@nate.com","oop","busan"));
		pageRanks.add(new PageRank(3,"red@nate.com","java","masan"));
		
		return new ModelAndView("jSonView","report",new PageRankReport(pageRanks));
	}
}
